﻿using System;
using System.Collections;
using System.Linq;
using System.Text;
using LocalView;
using DataType;
using Google.GData.Client;
using Google.Contacts;
using Google.Documents;
using Google.GData.Documents;
using System.IO;
using Google.GData.AccessControl;
using Excel = Microsoft.Office.Interop.Excel;
using Utilities;

namespace MyGDocsAddIn
{
    class ExcelCMSLocalView : ICMSLocalView
    {
        private bool isLoggedIn; 

        public delegate void StateNotify(string key);

        private global::System.Object missing = global::System.Type.Missing;

        public Excel.Application m_App;

        public override event EventHandler<SiteInfo> Login;
        public override event EventHandler<AtomFeedWrapper> GetContentFeed;
        public override event EventHandler<StringWrapper> GetFullTextContent;
        public override event EventHandler<PageInfo> UpdatePageContent;

        private DbOperations m_dbOperations;
        public StateNotify m_LoadState;
        public StateNotify m_StoreState;

        public ExcelCMSLocalView(Excel.Application App, DbOperations dbOperations)
        {
            m_App = App;
            m_DocInfo = null;
            m_dbOperations = dbOperations;
            isLoggedIn = false;
        }

        public override void DoLogin(SiteInfo cred)
        {
            if (Login != null)
                Login(this, cred);
           
            isLoggedIn = true;
        }


        public override void DoGetContentFeed(AtomFeedWrapper feed)
        {
            if (GetContentFeed != null)
                GetContentFeed(this, feed);
        }


        public override void DoGetFullTextContent(StringWrapper content)
        {
            throw new NotImplementedException();
        }

        public override void DoUpdatePageContent(PageInfo page)
        {
            throw new NotImplementedException();
        }
    }
}
